from django.conf.urls import patterns, url
from uidpapp.views import create_uidp, create_uidp_example, create_uidp_solution, create_uidps_rel
from categoriesapp.views import create_category, list_categories, get_category, list_category_uidps
from collectionsapp import views

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = patterns('',
    url('^$', views.list_collections),
    url('^collections/new$', views.create_collection),
    url('^categories/new$', create_category),
    url('^uidps/new$', create_uidp),
    
    url(r'^collections/(\d+)/$', views.list_patterns),
    url(r'^collections/(\d+)/json$', views.list_patterns_json),
    url(r'^collections/(\d+)/uidps/add/$', views.add_uidps_to_collection),
    url(r'^collections/(\d+)/uidps/select/$', views.select_uidps_from_collection),
    url(r'^collections/(\d+)/uidps/select/(\d+)$', views.select_uidps_from_collection_with_action),
    url(r'^collections/(\d+)/uidps/select/(\d+)/(\d+)$', views.select_uidps_from_collection_with_object),
    url(r'^collections/(\d+)/uidps/select/(\d+)/(\d+)/(\d+)$', views.select_uidps_from_collection_with_complement),
    url(r'^collections/(\d+)/uidps/add/(\d+)$', views.add_uidp_to_collection),
    url(r'^collections/(\d+)/uidps/remove/(\d+)$', views.remove_uidp_from_collection),
    
    url('^categories/$', list_categories),
    url('^categories/(\d+)/$', get_category),
    
    url(r'^collections/(\d+)/categories/(\d+)$', list_category_uidps),
    url(r'^collections/(\d+)/uidps/new/$', views.create_uidp_and_add_to_collection),
    
    url(r'^collections/(\d+)/uidps/(\d+)/$', views.display_collection_uidp),
    url(r'^collections/(\d+)/uidps/(\d+)/examples/new$', create_uidp_example),
    url(r'^collections/(\d+)/uidps/(\d+)/solutions/new$', create_uidp_solution),
    url(r'^collections/(\d+)/uidps/(\d+)/relationship/new$', create_uidps_rel),
    url(r'^collections/(\d+)/uidps/(\d+)/edit$', views.edit_collection_uidp),
)
